package com.itheima.test3;

public class TestLambda {
    public static void main(String[] args) {
        useStringHandler(new iStringHandler() {
            @Override
            public void printMessage(String msg) {
                System.out.println("我是匿名内部类 " + msg);
            }
        });

        useStringHandler(msg -> System.out.println("我是Lambda表达式 " + msg));
    }

    public static void useStringHandler(iStringHandler stringHandler) {
        stringHandler.printMessage("itheima");
    }
}

interface iStringHandler {
    void printMessage(String msg);
}
